﻿<!DOCTYPE html>
<html>
<head>
    <title>Angular App</title>
    <!--<style type="text/css">
        .container {
            background-color: #99CCFF;
            border: thick solid #808080;
            padding: 20px;
            margin: 20px;
        }
    </style>-->
   <!-- <link href="EventReg/css/bootstrap.min.css" rel="stylesheet" />-->
    <link href="EventReg/app/bootstrap.min.css" rel="stylesheet" /> 
    <link href="EventReg/css/app.css" rel="stylesheet" />
    <link href="EventReg/app/jquery-ui-darkness/css/jquery-ui-1.10.3.custom.css" rel="stylesheet" />
</head>
<body ng-app="eventsApp">
    <div></div>
    <div style="width: 190px; position: fixed; right: 20px; bottom: 20px; margin: 0 0 0 110px; background-color: #000000"><bold>CHAT</bold>
     <!--<div style="z-index: 1; position: relative; left: 20px; top: 1000px; background-color: #000000; width: 20%; height: 100px; padding: 0px; color: white; ">-->
         <div class="container">
             <ul id="discussion">
        </ul>
        <input type="text" id="message" /><br />
        <input type="button" id="sendmessage" value="Send" />
        <!--<input type="text" id="displayname" />-->
        
    </div></div> 
    <section id="anjular app">
        <div>
    <div class="navbar span10">
        <div class="navbar-inverse">
            <ul class="nav">
               <li> <a href="#/event">Event List</a></li>
                <li> <a href="#/newEvent">Create Event</a></li>
            </ul>
        </div>
    </div>
        </div> 
        
      <ng-view>
          
      </ng-view>
      
    </section>
    <section id="chat">
    <div id="dialog" title="Dialog Title">
    
    
    </div>
       
    
<!-- $.connection.hub.start().done(function () {});-->


    <!--Add script to update the page and send messages.--> 
  
    
        <!--AngularJS scripts.--> 
        <!--<script src="Scripts/jquery-1.6.4.js"></script>-->
      
      <!--  <script src="EventReg/app/jquery-ui-1.11.0/external/jquery/jquery.js"></script>-->
         <script src="Scripts/jquery-2.1.1.js"></script>
        <script src="Scripts/angular.js"></script>
        <script src="EventReg/app/app.js"></script>
        <script src="EventReg/app/controllers/EventController.js"></script>
        <script src="EventReg/js/bootstrap.js"></script>
        <script src="EventReg/app/filter.js"></script>
        <script src="EventReg/app/services/EventData.js"></script> 
        <script src="Scripts/angular-resource.js"></script>
        <script src="Scripts/angular-route.js"></script>
        <script src="EventReg/app/controllers/sessiondetail.js"></script>
        <script src="EventReg/app/directives/mySample.js"></script>
        <script src="EventReg/app/directives/voting.js"></script>
        <script src="EventReg/app/directives/datekeys.js"></script>
        <script src="EventReg/app/jquery-ui-darkness/js/jquery-ui-1.10.3.custom.js"></script>
        <!--<script src="EventReg/app/jquery-ui-1.11.0/jquery-ui.js"></script>
        <link href="EventReg/app/jquery-ui-1.11.0/jquery-ui.css" rel="stylesheet" />
        <link href="EventReg/app/jquery-ui-1.11.0/jquery-ui.theme.css" rel="stylesheet" />
        <link href="EventReg/app/jquery-ui-1.11.0/jquery-ui.structure.css" rel="stylesheet" />-->
        <script src="EventReg/app/directives/datepicker.js"></script>
        
        <!--Script references for chat. -->
    <!--Reference the jQuery library. -->
    
    <!--Reference the SignalR library. -->
    <script src="Scripts/jquery.signalR-2.1.0.min.js"></script>
    <!--Reference the autogenerated SignalR hub script. -->
    <script src="signalr/hubs"></script>
    </section>

      <script type="text/javascript">
          $(function () {
             

              $("#simpa").datepicker();
              // Declare a proxy to reference the hub. 
              var chat = $.connection.chatHub;
              // Create a function that the hub can call to broadcast messages.
              chat.client.broadcastMessage = function (name, message) {
                  // Html encode display name and message. 
                  var encodedName = $('<div />').text(name).html();
                  var encodedMsg = $('<div />').text(message).html();
                  // alert(name, message);
                  // Add the message to the page. 
                  $('#discussion').append('<li><strong>' + encodedName
                      + '</strong>:&nbsp;&nbsp;' + encodedMsg + '</li>');
                  var audio = new Audio('EventReg/app/sounds/beep-08b.mp3');
                  audio.play();
              };
              // Get the user name and store it to prepend to messages.
              //$('#displayname').val(prompt('Enter your name:', ''));
              // Set initial focus to message input box.  
              $('#message').focus();
              // Start the connection.
              $.connection.hub.logging = true;
              $.connection.hub.start().done(function () {
                  $('#sendmessage').click(function () {
                      // Call the Send method on the hub. 
                      chat.server.send($('#displayname').val(), $('#message').val());
                      // Clear text box and reset focus for next comment. 
                      $('#message').val('').focus();
                  });
                  $('#message').on('keydown', (function (event) {
                      if (event.keyCode == '13') {
                          // Call the Send method on the hub. 
                          chat.server.send($('#displayname').val(), $('#message').val());
                          // Clear text box and reset focus for next comment. 
                          $('#message').val('').focus();
                      };
                  }));
              });
          });
      </script>
</body>
</html>